{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "from multiprocessing import Process\r\n",
    "import requests\r\n",
    "import random\r\n",
    "\r\n",
    "from gen import *\r\n",
    "\r\n",
    "captchaURL = \"https://5eroyal.com/auth.php\"\r\n",
    "dicFilePath = r\"./passDic.txt\"\r\n",
    "# proxy = {\"http\": \"socks5://127.0.0.1:10808\"}\r\n",
    "proxy = None\r\n",
    "cookies = {\r\n",
    "    \"3941ddf92f1f50fe8180ec7043c1892d\": \"ypv3j07nqj0ds6yyg1v8vz7xzm02\",\r\n",
    "    \"4d859f85e3695eeb128ef56074bb7f7b\": \"kNnnNe08XC\",\r\n",
    "    \"d64d864b7095cdf2eecaacf9dda77839\": \"b2403bfaee3a0e37838b83045a94790d\",\r\n",
    "    \"timezoneOffset\": \"28800,0\",\r\n",
    "    \"d89663b5b8aef145c0b3f978b548ec53\": \"jTG1VT2NWTnROYVU5VG9vZzlHalJ2YTM2TG8zVlM0SGJUVEhPZFR4U01LdV8tSlVPY19OdE5PU2FkaHozOU9pcTlLYzRkS1RsOXdOZ2NPSGw5T3o0Y2h2dTBuTkE5T2pfTl9wXzBCY19kX1VhZk9TYWRoMHUwT3ZwZEtUTzkxMG05d1RPMHdHTzlPbGE5MW9BZkJpQmRWTkVObmN1Tk9RX2pzVXE5Vk5FTm5jcU5PUV82SjU0YzRRcGY0M2diT3hhdkI5M0xUcElMNmxrYzYwZWprUUFMczhQTl9wXzBCMF9kbEVfNko1bmZPTm1kaEYzZDFVT2NoamFmS3YzY2hpQmNPYTRjMVRIY0s5bGR3MGdmSjNwMm52Xy1KVXYtNHptMG5UbmMxVWFkS3Y0MEJqTzBLVWEwQkYzZHdUTzlLRkIwQlNIMDR6My1reHk5bU5FTmxwSWZ3OW5mbmZsZDFjbWZoTnVmNEduZmhpcDA0VWFkaGZsYzFGNDl3OWE5aFl5djEza05fcF82Sj1nZktGQWZCOUhkd05wY25GQWZLRkFkMVVhZktpQWNPaTRmaFkzOWhZbWRWM3AybnZfLUpVdi1CYW05MU51OXdUbjkxejRmbmNnZk96QmNCaW0wNEdIZmgwZWM0R2Fjbk5BLWt4eTltTkVObHBJY25VTzl3emUwblNuZGhTbGZ3RmVmS0ZxOW4wcTBLOU9jS3hIOXdHX2NCMHl2MTNrTl9wXzZKNUgwSzBtY0tvcTluOW5jS1RIZktmT2QxTjRjbmZIZDF6dTBCZkgwT2NtMG0zcDJudl8tSlV2LUJVSGRLWWdmT3ozY2hVSGQxTmVkMVVfMDRjcGZPTmdmT29lZmh2bTl3MHAta3h5OW1ORU5scEk5MTlPZkIwcDluZmxjS3p1OUthQTloMGVmaG9nZjFUXzkxRjNkS1VsZkJ2eWJ3ZklObHVFTm5jQU5PUV82SjVJdjFUeWJ3U0I2SjVFMjRqODJfVTU%3D\",\r\n",
    "}\r\n",
    "cookies = None\r\n",
    "capCode = \"qveq\""
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "def hunt(pid):\r\n",
    "    dic = open(dicFilePath, \"r\")\r\n",
    "    passDic = [line.replace(\"\\n\", \"\") for line in dic.readlines()]\r\n",
    "    while True:\r\n",
    "        try:\r\n",
    "            httpHeader = {\r\n",
    "                # \"Cache-Control\": \"max-age=0\",\r\n",
    "                \"Origin\": \"https://5eroyal.com\",\r\n",
    "                # \"Upgrade-Insecure-Requests\": \"1\",\r\n",
    "                \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.67\",\r\n",
    "                \"Accept\": \"*/*\",\r\n",
    "                \"Referer\": \"https://5eroyal.com/kNnnNe08XC/xqu0d57sj1/xtn97a3u0b?q=kNnnNe08XC&s=b2403bfaee3a0e37838b83045a94790d\",\r\n",
    "                \"Accept-Encoding\": \"gzip, deflate, br\",\r\n",
    "                \"Accept-Language\": \"zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6\",\r\n",
    "                \"ContentType\": \"application/x-www-form-urlencoded; charset=UTF-8\",\r\n",
    "                \"alt-svc\": 'h3-27=\":443\"; ma=86400, h3-28=\":443\"; ma=86400, h3-29=\":443\"; ma=86400, h3=\":443\"; ma=86400,0',\r\n",
    "                \"dnt\": \"1\",\r\n",
    "                \"sec-ch-ua\": '\" Not;A Brand\";v=\"99\", \"Microsoft Edge\";v=\"91\", \"Chromium\";v=\"91\"',\r\n",
    "                \"sec-ch-ua-mobile\": \"?0\",\r\n",
    "                \"sec-fetch-dest\": \"empty\",\r\n",
    "                \"sec-fetch-mode\": \"cors\",\r\n",
    "                \"sec-fetch-site\": \"same-origin\",\r\n",
    "            }\r\n",
    "\r\n",
    "            # postData = {\r\n",
    "            #     \"name\": genQQmail(),\r\n",
    "            #     \"pass\": chooseAPass(passDic),\r\n",
    "            #     \"code\": capCode,\r\n",
    "            #     \"face\": randomServer(),\r\n",
    "            #     \"zone\": randomDC(),\r\n",
    "            #     \"level\": \"幻想狂欢福袋\",\r\n",
    "            # }\r\n",
    "            postData = {\r\n",
    "                \"doAuth\": 1,\r\n",
    "                \"login\": genMobileNum(),\r\n",
    "                \"password\": chooseAPass(passDic),\r\n",
    "            }\r\n",
    "            r = requests.post(\r\n",
    "                captchaURL,\r\n",
    "                data=postData,\r\n",
    "                cookies=cookies,\r\n",
    "                headers=httpHeader,\r\n",
    "                proxies=proxy,\r\n",
    "            )\r\n",
    "            # print(r.content)\r\n",
    "            print(postData)\r\n",
    "            print(\"hunt his mum once\")\r\n",
    "        except Exception:\r\n",
    "            pass\r\n"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "DEBUG = False\r\n",
    "if DEBUG:\r\n",
    "    hunt(9999)\r\n",
    "else:\r\n",
    "    procPool = []\r\n",
    "    for p in range(48):\r\n",
    "        p = Process(target=hunt, args=(p,))\r\n",
    "        procPool.append(p)\r\n",
    "        p.start()"
   ],
   "outputs": [],
   "metadata": {}
  }
 ],
 "metadata": {
  "orig_nbformat": 4,
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}